// 导入一些系统设置
import{port} from './seting.js'
// 引入koa
import Koa from 'koa'
import Router from 'koa-router'

const app = new Koa()
let router = new Router()

app.use(async(ctx , next)=>{
    if(ctx.request.path === '/'){
        ctx.response.body = '第一个页面';
    }else{
        await next();
    }
})

app.use(async(ctx , next)=>{
    if(ctx.request.path === '/weixin'){
        ctx.response.body = 'wx';
    }else{
        await next();
    }
})

app.use(async(ctx , next)=>{
    if(ctx.request.path === '/alipay'){
        ctx.response.body = '支付宝';
    }else{
        await next();
    }
})

app.use(async(ctx , next)=>{
    if(ctx.request.path === '/ds'){
        ctx.response.body = 'gooooooooooodjjjjjjjjjj ???';
    }else{
        await next();
    }
})



app.listen(port)


console.log(`服务器运行在:http://localhost:${port}`)